﻿
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using élénkPróbája.results;
using élénkPróbája.validators;

namespace élénkPróbája
{
    /// <summary>
    /// A custom property validator.
    /// This interface should not be implemented directly in your code as it is subject to change.
    /// Please inherit from <see cref="LitmusPropertyValidator">PropertyValidator</see> instead.
    /// </summary>
    public interface ILitPropertyValidator
    {
        bool IsAsync { get; }

        IEnumerable<ValidationFailure> Validate(PropertyValidatorContext context);

        Task<IEnumerable<ValidationFailure>> ValidateAsync(PropertyValidatorContext context, CancellationToken cancellation);

        /// <summary>
        /// Custom message arguments. 
        /// Arg 1: Instance being validated
        /// Arg 2: Property value
        /// </summary>
        ICollection<Func<object, object, object>> CustomMessageFormatArguments { get; }
        Func<object, object> CustomStateProvider { get; set; }
        IStringSource ErrorMessageSource { get; set; }
        IStringSource ErrorCodeSource { get; set; }
    }
}